RAIS  3.2
C:/Projekte/RAIS/UI Common/SpecificReportManagement.cs
Go to the documentation of this file.
00001 
00027 using System;
00028 using System.Collections.Generic;
00029 using System.Linq;
00030 using System.Text;
00031 using System.Web.UI.WebControls;
00032 using System.Data;
00033 
00034 namespace RAIS.UI.Common
00035 {
00036     public class SpecificReportManagement
00037     {
00038         public static Dictionary<string, string> GetSubcategories(string category)
00039         {
00040             return ApplicationLogicLayer.SpecificReportManagement.GetSubcategories(category);
00041         }
00042 
00043         public static bool AddSpecificReport(string specificReportName, string fileName, string reportDefinition, ref int reportID)
00044         {
00045             return ApplicationLogicLayer.SpecificReportManagement.AddSpecificReport(specificReportName, fileName, reportDefinition, ref reportID);
00046         }
00047 
00048         public static Dictionary<string, string> GetReports()
00049         {
00050             return ApplicationLogicLayer.SpecificReportManagement.GetReports();
00051         }
00052 
00053         public static void InitControlsBySpecificReportID(int id, TextBox reportName, DropDownList ddlQuery, DropDownList ddlCategory, DropDownList ddlSubcategory, LinkButton lnkDownload, DropDownList ddlYesNo)
00054         {
00055             DataTable dt = ApplicationLogicLayer.SpecificReportManagement.GetReportByID(id);
00056             if (dt.Rows.Count > 0)
00057             {
00058                 DataRow row = dt.Rows[0];
00059                 reportName.Text = row["Specific Report Name"].ToString();
00060                 ddlQuery.SelectedIndex = ddlQuery.Items.IndexOf(ddlQuery.Items.FindByText(row["Query Name"].ToString()));
00061                 ddlCategory.SelectedIndex = ddlCategory.Items.IndexOf(ddlCategory.Items.FindByText(row["Category Name"].ToString()));
00062                 ddlSubcategory.Items.Clear();
00063                 foreach (KeyValuePair<string, string> pair in SpecificReportManagement.GetSubcategories(row["Category Name"].ToString()))
00064                 {
00065                     ddlSubcategory.Items.Add(new ListItem(pair.Value, pair.Key));
00066                 }
00067                 ddlSubcategory.SelectedIndex = ddlSubcategory.Items.IndexOf(ddlSubcategory.Items.FindByValue(row["FK Subcategory ID"].ToString()));
00068                 lnkDownload.Text = row["File Name"].ToString();
00069                 if (ApplicationLogicLayer.SpecificReportManagement.IsMenuItemGenerated(id))
00070                     ddlYesNo.SelectedIndex = 0;
00071                 else ddlYesNo.SelectedIndex = 1;
00072             }
00073         }
00074 
00075         public static bool UpdateSpecificReport(int specificReportID, int maskID, int dynamicMaskID, int subcategoryID, string specificReportName, string fileName, string reportDefinition)
00076         {
00077             return ApplicationLogicLayer.SpecificReportManagement.UpdateSpecificReport(specificReportID, maskID, dynamicMaskID, subcategoryID, specificReportName, fileName, reportDefinition);
00078         }
00079 
00080         public static int GetSubcategoryIDByReportID(int id)
00081         {
00082             return ApplicationLogicLayer.SpecificReportManagement.GetSubcategoryIDByReportID(id);
00083         }
00084 
00085         public static string GetSubcategoryNameByReportID(int id)
00086         {
00087             return ApplicationLogicLayer.SpecificReportManagement.GetSubcategoryNameByReportID(id);
00088         }
00089 
00090         public static bool RemoveSpecificReport(int id, ref string returnMessage)
00091         {
00092             return ApplicationLogicLayer.SpecificReportManagement.RemoveSpecificReport(id, ref returnMessage);
00093         }
00094 
00095         public static byte[] GetSpecificReportFile(int id)
00096         {
00097             return ApplicationLogicLayer.SpecificReportManagement.GetSpecificReportFile(id);
00098         }
00099 
00100         public static string GetSpecificReportDefinition(int reportID)
00101         {
00102             return ApplicationLogicLayer.SpecificReportManagement.GetSpecificReportDefinition(reportID);
00103         }
00104 
00105         public static List<string> GetQueryFieldsByID(int reportID)
00106         {
00107             return ApplicationLogicLayer.SpecificReportManagement.GetQueryFieldsByID(reportID);
00108         }
00109 
00110         public static void SaveReportDefinition(int reportID, string reportDefinition)
00111         {
00112             ApplicationLogicLayer.SpecificReportManagement.SaveReportDefinition(reportID, reportDefinition);
00113         }
00114 
00115         public static bool IsSpecificReport(int dynamicMaskID)
00116         {
00117             return ApplicationLogicLayer.SpecificReportManagement.IsSpecificReport(dynamicMaskID);
00118         }
00119 
00120         public static int GetSpecificReportID(int dynamicMaskID)
00121         {
00122             return ApplicationLogicLayer.SpecificReportManagement.GetSpecificReportID(dynamicMaskID);
00123         }
00124 
00125         public static DataTable GetQueryResult(string queryName, string parameter, string grouping, RAIS.Common.UserManagement.UserData currentUser, int dynamicMaskID)
00126         {
00127             return ApplicationLogicLayer.SpecificReportManagement.GetQueryResult(queryName, parameter, grouping, currentUser, dynamicMaskID);
00128         }
00129 
00130         public static DataTable GetDataTableFromQuery(string query)
00131         {
00132             return ApplicationLogicLayer.SpecificReportManagement.GetDataTableFromQuery(query);
00133         }
00134 
00135         public static List<string> GetSubreports(int reportID)
00136         {
00137             return ApplicationLogicLayer.SpecificReportManagement.GetSubreports(reportID);
00138         }
00139 
00140         public static int GetMaskIdByReportName(string reportName)
00141         {
00142             return ApplicationLogicLayer.SpecificReportManagement.GetMaskIdByReportName(reportName);
00143         }
00144 
00145         public static int GetSpecificReportIdByName(string reportName)
00146         {
00147             return ApplicationLogicLayer.SpecificReportManagement.GetSpecificReportIdByName(reportName);
00148         }
00149 
00150         public static string GetSpecificReportNameById(int specificReportID)
00151         {
00152             return ApplicationLogicLayer.SpecificReportManagement.GetSpecificReportNameById(specificReportID);
00153         }
00154 
00155         public static RAIS.Common.UserManagement.Mask GetMaskByReportName(string specificReportName)
00156         {
00157             return ApplicationLogicLayer.SpecificReportManagement.GetMaskByReportName(specificReportName);
00158         }
00159 
00160         public static bool IsSubreport(string specificReportName)
00161         {
00162             return ApplicationLogicLayer.SpecificReportManagement.IsSubreport(specificReportName);
00163         }
00164 
00165         public static void GenerateMenuItem(int specificReportID, bool generateMenuItem)
00166         {
00167             ApplicationLogicLayer.SpecificReportManagement.GenerateMenuItem(specificReportID, generateMenuItem);
00168         }
00169 
00170         public static void SetQuery(int dynamicMaskID, string queryName)
00171         {
00172             ApplicationLogicLayer.SpecificReportManagement.SetQuery(dynamicMaskID, queryName);
00173         }
00174     }
00175 }